﻿<phone:PhoneApplicationPage 
    x:Class="MobiSms.Wasun.Views.AboutAndHelpView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:viewmodel="clr-namespace:MobiSms.ViewModel;assembly=MobiSms.ViewModel"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.DataContext>
            <viewmodel:AboutAndHelpViewModel/>
        </Grid.DataContext>
        <Grid.Background>
            <ImageBrush ImageSource="{Binding GlobalSettings.BackgroundImage}" Stretch="{Binding GlobalSettings.BackgroundImageStretch}" />
        </Grid.Background>
        
        <controls:Panorama>
            <controls:Panorama.Title>
                <StackPanel Margin="12,76,0,0" Orientation="Horizontal">
                    <Image Source="{Binding LogoUri, Mode=OneWay}"/>
                    <StackPanel VerticalAlignment="Bottom">
                        <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Text="{StaticResource IDS_APP_SUBTITLE}"/>
                        <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="Ver 1.0 beta"/>
                    </StackPanel>
                </StackPanel>
            </controls:Panorama.Title>

            <controls:PanoramaItem Header="{StaticResource IDS_ABOUT_HEADER}">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text="{StaticResource IDS_APP_NAME}"/>
                            <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" 
                                       Text="for windows phone"/>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text=" "/>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text="{StaticResource IDS_ABOUT_APPINFO}"/>
                            <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" >
                                <Run Text="{StaticResource IDS_ABOUT_VERSION}"/>
                                <Run Text=" "/>
                                <Run Text="{Binding Version}"/>
                                <LineBreak/>
                                <Run Text="{Binding ReleaseDate,StringFormat=\{0:D\}}"/>
                            </TextBlock>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text=" "/>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text="{StaticResource IDS_ABOUT_CONTACT}"/>
                            <!--<TextBlock Style="{StaticResource PhoneTextAccentStyle}" 
                                       Text="zhaorong@outlook"/>-->
                            <HyperlinkButton HorizontalAlignment="Left" Foreground="{StaticResource PhoneAccentBrush}" 
                                             Command="{Binding SendMailCommand}"
                                             Content="zhaorong@outlook.com"/>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text=" "/>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text="{StaticResource IDS_ABOUT_FEEDBACK}"/>
                            <HyperlinkButton HorizontalAlignment="Left" Foreground="{StaticResource PhoneAccentBrush}"
                                             Command="{Binding OpenRateCommand}"
                                             Content="{StaticResource IDS_ABOUT_RATE}"/>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem Header="{StaticResource IDS_HELP_HEADER}">
                <Grid>
                    <ListBox ItemsSource="{Binding HelpCollection}">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ListBoxItem">
                                            <toolkit:ExpanderView Margin="0,12" >
                                                <toolkit:ExpanderView.Header>
                                                    <TextBlock Style="{StaticResource PhoneTextTitle3Style}" Foreground="{StaticResource PhoneChromeBrush}" TextWrapping="Wrap">
                                                        <Run Text="{Binding Id}"/>
                                                        <Run Text=". "/>
                                                        <Run Text="{Binding Question}"/>
                                                    </TextBlock>
                                                </toolkit:ExpanderView.Header>
                                                <ScrollViewer>
                                                    <TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding Answer}" TextWrapping="Wrap"/>
                                                </ScrollViewer>
                                            </toolkit:ExpanderView>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ListBox.ItemContainerStyle>
                    </ListBox>
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem Header="{StaticResource IDS_HELP_INTRODUCE}">
                <Grid>
                    <ScrollViewer>
                        <TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding IntroduceString}" TextWrapping="Wrap"/>
                    </ScrollViewer>
                </Grid>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>

    <!--Panorama-based applications should not show an ApplicationBar-->

</phone:PhoneApplicationPage>